home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / basic / vb4ex.zip / VBEX4.FRM (.txt) < prev    next >
Visual Basic Form  |  1992-03-14  |  5KB  |  118 lines

  1. VBEX4
  2. VISUAL BASICS Example 4
  3. Form1
  4. Label1
  5. Program Name: 
  6. lbl_InfoCaption
  7. LBL_InfoCaption
  8. lbl_Info
  9. LBL_Info
  10. FileMain
  11. &File
  12. FileExti
  13. E&xit
  14. Form_Click
  15. GetModuleFileName
  16. hModule2
  17. lpFilename
  18. nSize
  19. GCW_HMODULEv
  20. GetClassWord
  21. nIndex'
  22. GetActiveWindow
  23.     AsInteger
  24. EXEName/
  25.     hMyModule
  26. ModuleHandle
  27. EXEFileName,
  28. SuccessS
  29. ThisEXENameZ
  30. FileName_Clickl
  31. FileExti_Click
  32. Form_KeyUpn
  33. KeyCode
  34. Shift
  35. Form_MouseDown
  36. Buttonb
  37. Form_LostFocus
  38. @    Form_Load
  39. SepPathNFileName
  40. Fullname
  41. PathName
  42. FileName"
  43. SUCCEED
  44. ColonPos
  45.     BslashPos
  46. Saveddir
  47. DriveErr
  48. ErrorHandler
  49. LastOne
  50. SlashPos
  51. HelpLoc_Click
  52. Result
  53. SepPath
  54. Lbl_InfoCaption
  55. Caption
  56. Lbl_Info
  57. Memory
  58.     ProcessorV
  59. GetWinInfo
  60. GetFreeSpacel
  61. wFlags
  62. GetWinFlags;
  63. WF_STANDARD
  64. WF_ENHANCED
  65. WF_80x87
  66. WinFlags
  67. NulLoc
  68. InstrEXEFileName
  69. Label1
  70. VBEX4
  71. Kernel}
  72. Kernel
  73. Kernel
  74.  global to the form, loaded upon form load
  75. EXEName
  76. Author:
  77.  Barry Seymouri
  78. Date:
  79.  13Mar92 
  80. Explanation:   This Function returns a string containing the
  81.  name of the EXE file for the current program.
  82.  The GetModuleFileName function call is a Windows APIg
  83.  call defined in the declarations section of this module
  84.  or in the global module.a
  85. Use GetActiveWindow to get the currently active window.
  86. Since this function is called from within your program, the
  87. unavoidable conclusion is that YOUR program is the currently
  88. active window.
  89. We need to use GetClassWord to obtain a handle to our module.
  90. This is the first parameter required by GetModuleFileName.  In
  91. addition, we need to prepare a return buffer long enough to hold
  92. our EXE name:n
  93. Get the Module File name! 
  94. Trim off everything after the Null character...o
  95.  there's the return value 
  96. FileExti_Click
  97. Form_Load
  98. Memory Mode:
  99. Free Memory:
  100. Math CoProcessor:"
  101.  MUST SHOW WINDOW TO MAKE IT ACTIVE!
  102. Program Name: 
  103. SepPathNFileName
  104. This function parses a Fullname and attempts to break it down into PathName and Filename.
  105. It returns SUCCEED or FAIL.n
  106. It will FAIL if...
  107.  A colon is found anywhere other than the 2nd position or not at all.N
  108. If the function fails, it will return FAIL and FileName will return a string
  109. which describes the error which caused the function to fail.
  110. First Check to see if FileName is in fact a SUBDIRECTORY:-
  111.  drive and/or path spec.  NO Filename.
  112.  If we've gotten this far, Fullname is not justO
  113.  a directory name.  Parse...
  114.  No colon or backslash
  115. GetWinInfo
  116. 386 Enhanced
  117. Standard
  118.